<div class="layui-card">
    <div class="layui-card-header">
        <h2 class="header-title">录取及格</h2>
        <span class="layui-breadcrumb pull-right">
          <a href="#!console">首页</a>
          <a><cite>录取及格</cite></a>
        </span>
    </div>
    <div class="layui-card-body">
        <div class="layui-form toolbar">
            搜索：<select id="adm-search-key">
            <option value="">-请选择-</option>
            <option value="ksh">考生号</option>
            <option value="xm">姓名</option>
            <option value="lqzy">录取专业</option>
        </select>
            <input id="adm-search-value" class="layui-input search-input" type="text" placeholder="输入关键字"/>&emsp;
            <button id="adm-btn-search" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>搜索</button>
        </div>

        <table class="layui-table" id="adm-table" lay-filter="adm-table"></table>
    </div>
</div>

<script>
    layui.use(['form', 'table', 'util', 'config', 'admin', 'excel'], function () {
        var form = layui.form;
        var table = layui.table;
        var config = layui.config;
        var layer = layui.layer;
        var util = layui.util;
        var admin = layui.admin;
        let excel = layui.excel;

        // 渲染表格
        var renderTable = function () {
            table.render({
                elem: '#adm-table',
                // url: config.base_server + 'user_query.json',
                url: config.base_server + 'api-firebird/fireBird/getAdmInfoList',
                method: 'GET',
                where: {
                    access_token: config.getToken().access_token,
                },
                title: '报名信息表',
                page: true,
                toolbar: '#adm-tab-toolbar',
                cols: [[
                    {type: 'checkbox'},
                    {type: 'numbers'},
                    {field: 'candiNum', title: '考生号'},
                    {field: 'candiName', title: '考生姓名'},
                    {field: 'admMajor', title: '录取专业'},
                    {field: 'admType', title: '录取类型'},
                ]]
            });
        };
        renderTable();

        $("#adm-btn-search").click(function () {
            let key = $("#adm-search-key").val();
            let value = $("#adm-search-value").val();
            if (key!='ksh')
                value = value + '%';
            table.reload('adm-table', {where: {searchKey: key,searchValue: value}})
        });
    });
</script>